import React from 'react';
import { Image} from 'react-vant';

// 订单支付页
const OrderPay = (props) => {

    const { cartList } = props;

    return (
        <div style={{ height: '55vh', overflow: 'auto' }}>
            {
                cartList.map((item) => {
                    return (
                        <div className='orderPay' key={item.dishes_id}>
                            <Image src={item.dishes_img} width='70' height='50' fit='cover' />
                            <div className='dishesInfo'>
                                <h4>{item.dishes_name}</h4>
                                <span>x{item.qty}</span>
                            </div>
                            <p>
                                {
                                    item.sales_price
                                        ?
                                        (item.qty * item.sales_price).toFixed(2)
                                        :
                                        (item.qty * item.price).toFixed(2)
                                }
                            </p>
                        </div>
                    )
                })
            }
        </div>
    )

}

export default OrderPay